package cn.huyanbing.visual.spring.research.ocr;

/**
 * @BelongProject middleware
 * @BelongPackage cn.huyanbing.visual.spring.research.ocr
 * @Description TODO
 * @ClassName DocumentProcessor
 * @Author huyangbing
 * @Date 2025/1/13 09:52
 * @Version 1.0.0
 */
public class DocumentProcessor {

    public String processDocument(String imagePath) {
        OCRService ocrService = new OCRService();
        String text = ocrService.doOCR(imagePath);

        if (text != null && !text.isEmpty()) {
            InfoExtractor extractor = new InfoExtractor();
            String idNumber = extractor.extractIDNumber(text);

            return idNumber;  //  返回提取的身份证号
        }

        return null;
    }
}